package com.dalxx.oclioscope;

import java.util.Enumeration;
import java.util.Iterator;

public class EnumIterable<E> implements Iterable<E>
{
	Enumeration<E> enumIterator;
	public EnumIterable(Enumeration<E> e)
	{
		this.enumIterator=e;
	}
	@Override
	public Iterator<E> iterator() {
		
		return new EnumIterator<E>(this.enumIterator);
	}
	
	
	private class EnumIterator<X> implements Iterator<X> {
	
		Enumeration<X> Enum;
		public EnumIterator(Enumeration<X> e)
		{
			this.Enum=e;
		}
		
		@Override
		public boolean hasNext() {
			// TODO Auto-generated method stub
			
			return this.Enum.hasMoreElements();
		}
	
		@Override
		public X next() {
			// TODO Auto-generated method stub
			return this.Enum.nextElement();
		}
	
	}



	
}